home *** CD-ROM | disk | FTP | other *** search
/ PC Media 7 / PC MEDIA CD07.iso / share / prog / cm / cmstack.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-09-06  |  1.1 KB  |  30 lines

  1. // CmStack.h
  2. // -----------------------------------------------------------------
  3. // Compendium - C++ Container Class Library
  4. // Copyright (C) 1992-1994, Glenn M. Poorman, All rights reserved
  5. // -----------------------------------------------------------------
  6. // Stack definition.
  7. // -----------------------------------------------------------------
  8.  
  9. #ifndef _CMSTACK_H
  10. #define _CMSTACK_H
  11.  
  12. #include <cm/include/cmlist.h>
  13.  
  14. class CmStack : public CmLinkedList {       // Stack class definition.
  15. public:
  16.   CmStack();                                // Default stack constructor.
  17.   CmStack(const CmStack&);                  // Stack copy constructor.
  18.  ~CmStack() {}                              // Stack destructor.
  19.  
  20.   CmStack& operator=(const CmStack&);       // Assignment operator.
  21.  
  22.   Bool      push(CmObject*);                // Push object onto stack top.
  23.   CmObject* pop ();                         // Pop and return object from top.
  24.   CmObject* peek() const;                   // Return pointer to top object.
  25.  
  26.   CMOBJECT_DEFINE(CmStack, CmLinkedList)    // Define object funcs.
  27. };
  28.  
  29. #endif
  30.